<cfparam name="id" default="0">

<cfif isdefined('form.newusername')>
	<cfinclude template = "../act/update.cfm">
</cfif>

<cfinvoke component="cfcs.common.settings" method="getusers" returnvariable="qusers" userid="#id#"></cfinvoke>

<cfoutput query="qusers" maxrows="1">
<form name="form1" method="post" action="index.cfm?c=cpusers&a=edit&id=#id#">
  <h3>Edit User</h3>
  <table width="62%" border="0" cellspacing="0" cellpadding="4">
    <tr> 
      <td width="59%">Username:</td>
      <td width="41%"><input name="newusername" type="text" id="newusername" value="#username#" required="yes"></td>
    </tr>
    <tr>
      <td>Reset Password To: </td>
      <td><input name="newpassword" type="password" id="newpassword"></td>
    </tr>
    <tr>
      <td>Retype New Password:</td>
      <td><input name="newpassword_confirm" type="password" id="newpassword_confirm" /></td>
    </tr>
    <tr>
      <td>Name:</td>
      <td><input name="fullname" type="text" id="fullname" value="#fullname#" required="yes" /></td>
    </tr>
    <tr>
      <td>Email Address:</td>
      <td><input name="emailaddress" type="text" id="emailaddress" value="#emailaddress#" required="yes" /></td>
    </tr>
    <tr> 
      <td>User Level:</td>
      <td><select name="userlevel" id="userlevel">
          <option <cfif userlevel IS '2'>selected="selected"</cfif> value="2">User</option>
          <option <cfif userlevel IS '1'>selected="selected"</cfif> value="1">Admin</option>
        </select></td>
    </tr>
    
    <tr> 
      <td colspan="2"><div align="center"> 
          <input type="hidden" name="id" value="#id#">
          <input type="submit" name="Submit" id="abutton" value="Update User Settings">
        </div></td>
    </tr>
  </table>
  <p>&nbsp;</p>
</form>
</cfoutput>